package org.example.controller;

import org.example.domain.Tb_dept;
import org.example.service.Tb_deptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller
public class Tb_deptController {
    @Autowired
    private Tb_deptService tb_deptService;

    @RequestMapping("/findDept")
    @ResponseBody
    public List<Tb_dept> findDept(Model model) {
        return tb_deptService.findAll();

    }
}
